define(function (require, exports, module) {	
    var tpl1 = require("/mobile/tpl/redpacket/redEnvelope.tpl");
    var tpl2 = require("/mobile/tpl/redpacket/coupon.tpl");
    var tpl3 = require("/mobile/tpl/redpacket/wineCoupon.tpl");
    var tpl4 = require("/mobile/tpl/redpacket/winebuyBack.tpl");
    var AjaxReturn = require('/plugins/extend/AjaxReturn');   
    require.async('common1', function () {
        $(".container").tabChange({
            isClick: true,
            isHover: false,
            childLi: ".productMenu span",//tab选项卡
            childContent: ".redPacket",//tab内容
            hoverClassName: "select",//选中当前选项卡的样式
            callBack: function (index) {
              /*  if (index == 0) {
                    AjaxReturn.ajaxPacket("/app/user/redEnvelopeJSON.html", "get", tpl1, "#redPacket");
                } else {
                    AjaxReturn.ajaxPacket("/app/user/myRateInterestList.html", "get", tpl2, "#coupon");
                }*/
                switch(index){
                case 0:
                	 AjaxReturn.ajaxPacket("/app/user/redEnvelopeJSON.html", "get", tpl1, "#redPacket");
                	 break;
                case 1:
                	 AjaxReturn.ajaxPacket("/app/user/myRateInterestList.html", "get", tpl2, "#coupon");
                	 break;
                case 2:
	               	 AjaxReturn.ajaxPacket("/app/member/redpacket/availableWineCouponsJSON.html", "get", tpl3, "#wineCoupon");
	               	 break;  
                case 3:
	               	 AjaxReturn.ajaxPacket("/app/member/redpacket/availableWineCouponsJSON.html", "get", tpl4, "#winebuyBack");
	               	 break; 
                }
            }
        });         
    });     
AjaxReturn.ajaxPacket("/app/user/redEnvelopeJSON.html", "get", tpl1, "#redPacket");
});